@import '~scss/variables';
@import '~scss/mixins';

.main {
  &.table {
    padding: 0;

    > div:first-child {
      height: 40px;
      padding: 20px 20px 0;
    }

    .header {
      display: flex;
      padding: 8px 20px;
      background-color: $th-bg-color;
      box-shadow: 0 1px 0 0 $light-color03;

      .search {
        width: 100%;
      }

      .actions {
        flex: 1 0 auto;

        :global {
          button {
            margin-left: 12px;

            &:hover {
              background-color: $bg-color;
            }
          }
        }
      }
    }

    .body {
      min-height: 80px;
      padding: 12px 20px;
    }

    .footer {
      padding: 8px 20px;
      border-radius: 0 0 8px 8px;
      background-color: $th-bg-color;
      box-shadow: 0 -1px 0 0 $light-color03;
    }
  }
}

.item {
  margin-bottom: 8px;
  line-height: 20px;
  background-color: $th-bg-color;
  border-radius: 4px;

  &:last-child {
    margin-bottom: 0;
  }
}

.expanded {
  position: relative;

  .arrow {
    :global(.icon) {
      transform-origin: center center;
      transform: rotate(180deg);
    }
  }

  .itemMain {
    margin: 0 -4px;
    background-color: #242e42;

    .icon {
      .status {
        border-color: #242e42;
      }
    }
    dl {
      dd, dt {
        color: $white;
      }
    }

  }

  .itemExtra {
    display: block;
  }
}

.itemMain {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px;
  background-color: $white;
  border: 1px solid $border-color;
  border-radius: 4px;
  cursor: pointer;

  .icon {
    position: relative;
    margin-right: 12px;
    min-width: 40px;

    .status {
      position: absolute;
      right: 2px;
      bottom: 7px;
      width: 16px;
      height: 16px;
      border-radius: 50%;
      border: 2px solid $white;
    }

    .statusTip {
      strong {
        color: $white;
      }
    }
  }

  .content {
    display: table;
    table-layout: fixed;
    width: 100%;
    line-height: 20px;

    strong {
      font-size: $size-normal;
      font-weight: 600;
      color: $text-color;
      @include break-all;
    }

    :global(.spin-nested-loading) {
      position: relative;
    }

    & > div {
      position: static;
      display: table-cell;
      vertical-align: middle;
      min-height: 40px;
      padding: 0 20px;
      border-left: 1px dashed $btn-flat-active-bg;
      transform: none;

      &:first-child,
      &:last-child {
        border-left: none;
      }

      &.base {
        width: 28%;
      }

      &.info {
        width: 32%;
      }

      &.arrow {
        width: 5%;

        :global(.icon) {
          transition: all $trans-speed;
        }
      }
    }

    p {
      color: $light-color08;
    }

    strong {
      font-family: $font-family-id;
    }

    .monitors {
      .charts {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0 -10px;

        & > div {
          margin: 0 10px;
        }
      }
    }

    .record {
      display: flex;
      line-height: 20px;

      label {
        white-space: nowrap;
      }

      .text {
        margin: 0 0 0 5px;
        word-break: break-all;
        @include break-all;

        > span {
          color: $light-color08;
          margin-left: 5px;
        }
      }
    }
  }

  dl {
    display: table-cell;
    line-height: 20px;
    vertical-align: middle;

    &.more {
      display: table-cell;
      width: 20px;
    }

    dt {
      font-weight: bold;
      color: $text-color;
    }

    dd {
      color: $second-text-color;
    }
  }
}

.itemExtra {
  display: none;
  position: absolute;
  top: 66px;
  left: 0;
  z-index: 2;
  width: 100%;
  margin-bottom: 20px;
  padding: 12px;
  background-color: $white;
  border: 1px solid $border-hover-color;
  border-top: 0 none;
  box-shadow: 0 4px 8px 0 rgba(36, 46, 66, 0.2);
  border-radius: 0 0 4px 4px;
  transition: all $trans-speed;

  .actions {
    position:  absolute;
    display: inline-block;
    top: 12px;
    right: 12px;
    z-index: 3;
    line-height: 32px;
  }
}

.loading {
  display: flex;
  justify-content: center;
  padding: 20px 0;
}

.empty {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 56px;
}

.handleContent {
  margin-top: 12px;
  padding: 12px;
  border-radius: 4px;
  background-color: $lightest;
}
